package com.eims.sls_app.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.android.volley.toolbox.RequestParams;
import com.eims.sls_app.dataaccess.CircleBean;
import com.eims.sls_app.dataaccess.utils.HttpUtils;
import com.eims.sls_app.protocol.RspBodyBaseBean;
import com.eims.sls_app.utils.App;
import com.eims.sls_app.utils.AppTools;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import bls.juejin.cn.R;

public class SelectRechargeTypeActivity1 extends MyBaseActivity implements
		View.OnClickListener {
	private Activity context = SelectRechargeTypeActivity1.this;
	public  String TAG = "SelectRechargeTypeActivity";
	private RelativeLayout layout_uppay;// 银联支付

	
	
	private RelativeLayout layout_paysapi_alipay;// paysapi支付宝支付
	private RelativeLayout layout_paysapi_wxpay;// paysapi微信支付
	private RelativeLayout layout_saoma_alipay;// 支付宝支付
	private RelativeLayout layout_wxpay;// 微信支付
	private RelativeLayout layout_saoma_wxpay;// 微信扫码支付
	private RelativeLayout layout_sh_saoma_wxpay;// 上海微信扫码支付

	private RelativeLayout layout_new_wxpay;// 新微信支付
	private RelativeLayout layout_recommend_wxpay;// 支付宝支付（推荐）
	private RelativeLayout layout_qq_pay;// qq钱包支付
	private RelativeLayout layout_alipay_shortcut;
	
	private RelativeLayout layout_wpqq_pay;
	
	
	private RelativeLayout layout_dianzhu_info_show;

	private ImageButton btn_back;// 返回
	private TextView tv_tip;
	
	private String opt, auth, info, time, imei, crc; // 格式化后的参数

	private MyHandler mHandler;
	private MyAsynTask mMyAsynTask;
	private CircleBean circleBean;
	
	private String listShowValue;

	private RelativeLayout layout_weipai_alipay;//微派支付宝支付
	private RelativeLayout layout_weipai_wxpay;//微派微信支付

	private RelativeLayout layout_taiji_alipay;//太极支付宝支付
	private RelativeLayout layout_taiji_wxpay;//太极微信支付

	private RelativeLayout layout_shunlifu_alipay;//顺利付支付宝支付
	private RelativeLayout layout_shunlifu_yinlian;//顺利付银联支付
	private RelativeLayout layout_shunlifu_wangyin;//顺利付网银支付

	private RelativeLayout layout_shoumile_wangyin;//最新支付宝支付 http://cz.shoumile.cn-  2019 3.12
	private TextView tvShow;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_select_paytype_1);
		mHandler=new MyHandler();
		findView();
		setListener();
		init();
		
		
		
		
		mMyAsynTask = new MyAsynTask();
		mMyAsynTask.execute();
	}

	public void findView() {
		layout_uppay = (RelativeLayout) findViewById(R.id.layout_uppay);
	
		layout_saoma_alipay = (RelativeLayout) findViewById(R.id.layout_saoma_alipay);
		layout_wxpay = (RelativeLayout) findViewById(R.id.layout_wxpay);
		layout_alipay_shortcut = (RelativeLayout)findViewById(R.id.layout_alipay_shortcut);
		layout_sh_saoma_wxpay= (RelativeLayout)findViewById(R.id.layout_sh_saoma_wxpay);
		layout_recommend_wxpay=(RelativeLayout) findViewById(R.id.layout_alipay_recommend_shortcut);
		layout_qq_pay=(RelativeLayout) findViewById(R.id.layout_alipay_QQ_shortcut);
		layout_new_wxpay=(RelativeLayout) findViewById(R.id.layout_new_wxpay);
		btn_back = (ImageButton) findViewById(R.id.btn_back);
		tv_tip = (TextView) findViewById(R.id.tv_tip);
		tvShow=(TextView) findViewById(R.id.tv_show);
		
		layout_paysapi_alipay=(RelativeLayout) findViewById(R.id.layout_paysapi_alipay);
		layout_paysapi_wxpay=(RelativeLayout) findViewById(R.id.layout_paysapi_wxpay);
		
		layout_dianzhu_info_show=(RelativeLayout) findViewById(R.id.layout_dzpay);
		
		layout_saoma_wxpay=(RelativeLayout) findViewById(R.id.layout_saoma_wxpay);
		
		layout_wpqq_pay=(RelativeLayout) findViewById(R.id.layout_alipay_WPQQ_shortcut);
		layout_weipai_alipay=(RelativeLayout) findViewById(R.id.layout_weipai_alipay);
		layout_weipai_wxpay=(RelativeLayout) findViewById(R.id.layout_weipai_wxpay);


		layout_shunlifu_alipay = (RelativeLayout) findViewById(R.id.layout_shunlifu_alipay);
		layout_shunlifu_yinlian = (RelativeLayout) findViewById(R.id.layout_shunlifu_yinlian);

		layout_shunlifu_wangyin = (RelativeLayout) findViewById(R.id.layout_shunlifu_wangyin);

	 layout_taiji_alipay= (RelativeLayout) findViewById(R.id.layout_alipay_taiji_shortcut);
		layout_taiji_wxpay= (RelativeLayout) findViewById(R.id.layout_taji_wxpay);


		layout_shoumile_wangyin= (RelativeLayout) findViewById(R.id.layout_shoumile_alipay);
	}

	public void setListener() {
		layout_uppay.setOnClickListener(this);
		layout_sh_saoma_wxpay.setOnClickListener(this);
		layout_wxpay.setOnClickListener(this);
		layout_alipay_shortcut.setOnClickListener(this);
	
		layout_recommend_wxpay.setOnClickListener(this);
		btn_back.setOnClickListener(this);
		layout_qq_pay.setOnClickListener(this);
		layout_new_wxpay.setOnClickListener(this);
		layout_saoma_alipay.setOnClickListener(this);
		layout_saoma_wxpay.setOnClickListener(this);
		
		layout_paysapi_alipay.setOnClickListener(this);
		layout_paysapi_wxpay.setOnClickListener(this);
		
		layout_dianzhu_info_show.setOnClickListener(this);
		
		layout_wpqq_pay.setOnClickListener(this);
		layout_weipai_alipay.setOnClickListener(this);
		layout_weipai_wxpay.setOnClickListener(this);
//		layout_alipay_shortcut.setVisibility(View.VISIBLE);

		layout_shunlifu_alipay.setOnClickListener(this);
		layout_shunlifu_yinlian.setOnClickListener(this);
		layout_shunlifu_wangyin.setOnClickListener(this);

		layout_taiji_alipay.setOnClickListener(this);
		layout_taiji_wxpay.setOnClickListener(this);
		layout_shoumile_wangyin.setOnClickListener(this);
	
	}

	public void init() {
		
		
		Spanned spanned = Html.fromHtml(AppTools.changeStringColor("#000000",
				"银联支付") + AppTools.changeStringColor("#e3393c", ""));
		tv_tip.setText(spanned);
		
//		Spanned spanned1 = Html.fromHtml(App.changeStringColor("#808080",
//				"温馨提示：手机触屏版也可以微信和支付宝充值哦，")
//				+ App.changeStringColor("#0d52c3",
//						"戳我戳我戳我！"));
//		tvShow.setText(spanned1);
		tvShow.setText(getClickableSpan());
		 //此行必须有  
		tvShow.setMovementMethod(LinkMovementMethod.getInstance()); 
		
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		Intent intentResuls = getIntent();
		setResult(2, intentResuls);
		finish();
	}
	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.btn_back:// 返回
			finish();
		
			break;
		case R.id.layout_uppay:// 银联支付
			// Intent intent1=new Intent(context,RechargeUPActivity.class);
			// context.startActivity(intent1);
			Intent intent_uppay = new Intent();
			Bundle bundle = new Bundle();
			intent_uppay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle.putInt("Type", 1);
			intent_uppay.putExtras(bundle);
			startActivity(intent_uppay);
			break;

		case R.id.layout_wxpay:
			Intent intent_wxpay = new Intent();
			Bundle bundle_wxpay = new Bundle();
			intent_wxpay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle_wxpay.putInt("Type", 3);
			intent_wxpay.putExtras(bundle_wxpay);
			startActivity(intent_wxpay);
			
			
			break;
		case R.id.layout_alipay_shortcut:
			Intent intent_alipay_shortcut = new Intent();
			Bundle bundle_alipay_shortcut = new Bundle();
			intent_alipay_shortcut.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle_alipay_shortcut.putInt("Type", 4);
			intent_alipay_shortcut.putExtras(bundle_alipay_shortcut);
			startActivity(intent_alipay_shortcut);
			break;
		case R.id.layout_alipay_recommend_shortcut:
			Intent intent_alipay_recommend_shortcut = new Intent();
			Bundle bundle_alipay_recommend_shortcut = new Bundle();
			intent_alipay_recommend_shortcut.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle_alipay_recommend_shortcut.putInt("Type", 5);
			intent_alipay_recommend_shortcut.putExtras(bundle_alipay_recommend_shortcut);
			startActivity(intent_alipay_recommend_shortcut);
			
			break;
		case R.id.layout_alipay_QQ_shortcut:
			Intent intent_alipay_qq_shortcut = new Intent();
			Bundle bundle_alipay_qq_shortcut = new Bundle();
			intent_alipay_qq_shortcut.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle_alipay_qq_shortcut.putInt("Type", 6);
			intent_alipay_qq_shortcut.putExtras(bundle_alipay_qq_shortcut);
			startActivity(intent_alipay_qq_shortcut);
			break;
		case R.id.layout_new_wxpay:
			
			Intent intent_new_wxpay = new Intent();
			Bundle bundle_new_wxpay = new Bundle();
			intent_new_wxpay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfChargeTonew.class);
			bundle_new_wxpay.putInt("Type", 7);
			intent_new_wxpay.putExtras(bundle_new_wxpay);
			startActivity(intent_new_wxpay);
			
			break;

		case R.id.layout_saoma_alipay:// 支付宝扫码支付
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_saoma_alipay = new Intent();
			Bundle bundle_saoma_alipay = new Bundle();
			intent_saoma_alipay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_saoma_alipay.putInt("Type", 9);
			intent_saoma_alipay.putExtras(bundle_saoma_alipay);
			startActivity(intent_saoma_alipay);
			break;
		case R.id.layout_saoma_wxpay:// 微信扫码支付
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_saoma_wxpay = new Intent();
			Bundle bundle_saoma_wxpay = new Bundle();
			intent_saoma_wxpay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_saoma_wxpay.putInt("Type", 10);
			intent_saoma_wxpay.putExtras(bundle_saoma_wxpay);
			startActivity(intent_saoma_wxpay);
			break;
		case R.id.layout_sh_saoma_wxpay:// 微信扫码支付
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
	//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_sh_saoma_wxpay = new Intent();
			Bundle bundle_sh_saoma_wxpay = new Bundle();
			intent_sh_saoma_wxpay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_sh_saoma_wxpay.putInt("Type", 11);
			intent_sh_saoma_wxpay.putExtras(bundle_sh_saoma_wxpay);
			startActivity(intent_sh_saoma_wxpay);
			break;
		case R.id.layout_paysapi_alipay:// 支付宝扫码支付
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_paysapi_alipay = new Intent();
			Bundle bundle_paysapi_alipay = new Bundle();
			intent_paysapi_alipay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_paysapi_alipay.putInt("Type",12);
			intent_paysapi_alipay.putExtras(bundle_paysapi_alipay);
			startActivity(intent_paysapi_alipay);
			break;
		case R.id.layout_paysapi_wxpay:// 微信扫码支付
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_paysapi_wxpay = new Intent();
			Bundle bundle_paysapi_wxpay = new Bundle();
			intent_paysapi_wxpay.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_paysapi_wxpay.putInt("Type", 13);
			intent_paysapi_wxpay.putExtras(bundle_paysapi_wxpay);
			startActivity(intent_paysapi_wxpay);
			break;
			
//		case R.id.layout_dzpay:// 微信扫码支付
//			// 跳到充值页面
////			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
////
////			 Intent intent_alipay = new Intent();
////			 intent_alipay.setClass(context, PayWebActivity.class);
////			 context.startActivity(intent_alipay);
//			Intent intent_layout_dzpay = new Intent();
//
//			intent_layout_dzpay.setClass(SelectRechargeTypeActivity.this,
//					DianzhuInfoShowActivity.class);
//
//
//			startActivity(intent_layout_dzpay);
//			break;
			
		case R.id.layout_alipay_WPQQ_shortcut:
			// 跳到充值页面
//			 Intent intent_alipay = new Intent(context, RechargeActivity.class);
//
//			 Intent intent_alipay = new Intent();
//			 intent_alipay.setClass(context, PayWebActivity.class);
//			 context.startActivity(intent_alipay);
			Intent intent_alipay_WPQQ = new Intent();
			Bundle bundle_alipay_WPQQ = new Bundle();
			intent_alipay_WPQQ.setClass(SelectRechargeTypeActivity1.this,
					AmountOfCharge.class);
			bundle_alipay_WPQQ.putInt("Type",14);
			intent_alipay_WPQQ.putExtras(bundle_alipay_WPQQ);
			startActivity(intent_alipay_WPQQ);
			break;


			case R.id.layout_weipai_alipay:
				// 跳到充值页面

				Intent intent_alipay_WPalipay = new Intent();
				Bundle bundle_alipay_WPalipay = new Bundle();
				intent_alipay_WPalipay.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_alipay_WPalipay.putInt("Type",15);
				intent_alipay_WPalipay.putExtras(bundle_alipay_WPalipay);
				startActivity(intent_alipay_WPalipay);
				break;
			case R.id.layout_weipai_wxpay:
				// 跳到充值页面

				Intent intent_alipay_WPwxpay = new Intent();
				Bundle bundle_alipay_WPwxpay = new Bundle();
				intent_alipay_WPwxpay.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_alipay_WPwxpay.putInt("Type",16);
				intent_alipay_WPwxpay.putExtras(bundle_alipay_WPwxpay);
				startActivity(intent_alipay_WPwxpay);
				break;
			case R.id.layout_shunlifu_alipay:
				// 跳到充值页面

				Intent intent_shunlifu_alipay = new Intent();
				Bundle bundle_shunlifu_alipay = new Bundle();
				intent_shunlifu_alipay.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_shunlifu_alipay.putInt("Type", 17);
				intent_shunlifu_alipay.putExtras(bundle_shunlifu_alipay);
				startActivity(intent_shunlifu_alipay);
				break;
			case R.id.layout_shunlifu_yinlian:
				// 跳到充值页面

				Intent intent_shunlifu_yinlian = new Intent();
				Bundle bundle_shunlifu_yinlian = new Bundle();
				intent_shunlifu_yinlian.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_shunlifu_yinlian.putInt("Type", 18);
				intent_shunlifu_yinlian.putExtras(bundle_shunlifu_yinlian);
				startActivity(intent_shunlifu_yinlian);
				break;
			case R.id.layout_shunlifu_wangyin:
				// 跳到充值页面

				Intent intent_shunlifu_wangyin = new Intent();
				Bundle bundle_shunlifu_wangyin = new Bundle();
				intent_shunlifu_wangyin.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_shunlifu_wangyin.putInt("Type", 19);
				intent_shunlifu_wangyin.putExtras(bundle_shunlifu_wangyin);
				startActivity(intent_shunlifu_wangyin);
				break;


			case R.id.layout_alipay_taiji_shortcut:
				// 跳到充值页面

				Intent intent_taiji_shortcut = new Intent();
				Bundle bundle_taiji_shortcut = new Bundle();
				intent_taiji_shortcut.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_taiji_shortcut.putInt("Type",20);
				intent_taiji_shortcut.putExtras(bundle_taiji_shortcut);
				startActivity(intent_taiji_shortcut);
				break;
			case R.id.layout_taji_wxpay:
				// 跳到充值页面

				Intent intent_taji_wxpay= new Intent();
				Bundle bundle_taji_wxpay = new Bundle();
				intent_taji_wxpay.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_taji_wxpay.putInt("Type", 21);
				intent_taji_wxpay.putExtras(bundle_taji_wxpay);
				startActivity(intent_taji_wxpay);
				break;
			case R.id.layout_shoumile_alipay:
				// 跳到充值页面

				Intent intent_shoumile_wxpay= new Intent();
				Bundle bundle_shoumile_wxpay = new Bundle();
				intent_shoumile_wxpay.setClass(SelectRechargeTypeActivity1.this,
						AmountOfCharge.class);
				bundle_shoumile_wxpay.putInt("Type", 22);
				intent_shoumile_wxpay.putExtras(bundle_shoumile_wxpay);
				startActivity(intent_shoumile_wxpay);
				break;

	}
	}
	
 class MyAsynTask extends AsyncTask<Integer, Integer, String> {

		String error = "-1";

		@Override
		protected String doInBackground(Integer... params) {
			info = "";
			opt = "97";
			time = RspBodyBaseBean.getTime();
			imei = RspBodyBaseBean.getIMEI(SelectRechargeTypeActivity1.this);
			// info = RspBodyBaseBean.change_TheSun(schemeId+"", context_Sun);

			// String key = MD5.md5(App.user.getUserPass() +
			// App.MD5_key);
			String key = App.key;
			
				crc = RspBodyBaseBean.getCrc(time, imei, key, info,
						App.user.getUid());
				auth = RspBodyBaseBean.getAuth(crc, time, imei,
						App.user.getUid());
			

			String[] values = { opt, auth, info };
			Log.e(TAG,
					"晒单"
							+ RequestParams.convertParams(SelectRechargeTypeActivity1.this,
									opt, info));
			String result = HttpUtils.doPost(App.names, values,
					App.path);
			System.out.println("晒单：" + result);
			
		
			
			
			
			try {
				JSONArray 	arr = new JSONArray(result);
				  JSONObject temp = (JSONObject) arr.get(0);  
				   listShowValue = temp.getString("Value");  
				    Log.e(TAG, "晒单id" + listShowValue);
				
				    
				    
				    if (listShowValue!=null&&!listShowValue.equals("")) {
				    	
				    	 error = "1";	
				    	
				
				    	
//				    	String isShowValue=(listShowValue.split("|"))[0];
//				    	Log.i(TAG, "晒单id" + isShowValue);
				    	
					}
				    
				    
				    
			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				error = "-1";
				Log.e("x", "MyCenterActivity异常" + e.getMessage());
			}  
			
	
			
			return error;
		}

		@Override
		protected void onPostExecute(String result) {

			mHandler.sendEmptyMessage(Integer.parseInt(result));

			super.onPostExecute(result);
		}
	}

	@SuppressLint("HandlerLeak")
	class MyHandler extends Handler {
		@Override
		public void handleMessage(Message msg) {

			switch (msg.what) {
			case 0:

				break;
			case 1:
				String listValue[]=new String[listShowValue.length()];
		    	for (int i = 0; i < listShowValue.length(); i++) {
		    		listValue[i]=listShowValue.substring(i, i+1);
		    		 Log.i(TAG, "晒单id" + listValue[i]);
				}
//				if (listValue[0].equals("1")) {
//					layout_saoma_alipay.setVisibility(View.GONE);
//				}else {
//					layout_saoma_alipay.setVisibility(View.GONE);
//				}
//				if (listValue[1].equals("1")) {
//					layout_saoma_wxpay.setVisibility(View.GONE);
//				}else {
//					layout_saoma_wxpay.setVisibility(View.GONE);
//				}
				if (listValue[2].equals("1")) {
					layout_recommend_wxpay.setVisibility(View.VISIBLE);
				}else {
					layout_recommend_wxpay.setVisibility(View.GONE);
				}
				if (listValue[3].equals("1")) {
					layout_qq_pay.setVisibility(View.VISIBLE);
				}else {
					layout_qq_pay.setVisibility(View.GONE);
				}
				if (listValue[4].equals("1")) {
					layout_alipay_shortcut.setVisibility(View.VISIBLE);
				}else {
					layout_alipay_shortcut.setVisibility(View.GONE);
				}
				if (listValue[5].equals("1")) {
					layout_paysapi_alipay.setVisibility(View.VISIBLE);
				}else {
					layout_paysapi_alipay.setVisibility(View.GONE);
				}
				
				if (listValue[6].equals("1")) {
					layout_paysapi_wxpay.setVisibility(View.VISIBLE);
				}else {
					layout_paysapi_wxpay.setVisibility(View.GONE);
				}
//				if (listValue[7].equals("1")) {
//					layout_dianzhu_info_show.setVisibility(View.GONE);
//				}else {
//					layout_dianzhu_info_show.setVisibility(View.GONE);
//				}
				if (listValue[8].equals("1")) {
					layout_wpqq_pay.setVisibility(View.VISIBLE);
				}else {
					layout_wpqq_pay.setVisibility(View.GONE);
				}
				if (listValue[9].equals("1")) {
					layout_weipai_alipay.setVisibility(View.VISIBLE);
				}else {
					layout_weipai_alipay.setVisibility(View.GONE);
				}
				if (listValue[10].equals("1")) {
					layout_shunlifu_alipay.setVisibility(View.VISIBLE);
				}else {
					layout_shunlifu_alipay.setVisibility(View.GONE);
				}
				if (listValue[11].equals("1")) {
					layout_shunlifu_yinlian.setVisibility(View.VISIBLE);
				}else {
					layout_shunlifu_yinlian.setVisibility(View.GONE);
				}
				if (listValue[12].equals("1")) {
					layout_shunlifu_wangyin.setVisibility(View.VISIBLE);
				}else {
					layout_shunlifu_wangyin.setVisibility(View.GONE);
				}
				if (listValue[13].equals("1")) {
					layout_weipai_wxpay.setVisibility(View.VISIBLE);
				}else {
					layout_weipai_wxpay.setVisibility(View.GONE);
				}
				if (listValue[14].equals("1")) {
					layout_taiji_alipay.setVisibility(View.VISIBLE);
				}else {
					layout_taiji_alipay.setVisibility(View.GONE);
				}
				if (listValue[15].equals("1")) {
					layout_taiji_wxpay.setVisibility(View.VISIBLE);
				}else {
					layout_taiji_wxpay.setVisibility(View.GONE);
				}
//				if (listValue[16].equals("1")) {
//					layout_shoumile_wangyin.setVisibility(View.VISIBLE);
//				}else {
//					layout_shoumile_wangyin.setVisibility(View.GONE);
//				}
				break;




			case -1:

				break;
			case -500:

				break;
			default:
				break;
			}
			super.handleMessage(msg);
		}

	}

	 private SpannableString getClickableSpan() {  
		  
	        //监听器  
	        View.OnClickListener listener = new View.OnClickListener() {  
	            @Override  
	            public void onClick(View v) {  
	             
	            	Intent intent = new Intent();
	    			intent.setAction("android.intent.action.VIEW");
	    			Uri content_url = Uri.parse("http://m.haoqiucai.com");
	    			intent.setData(content_url);
	    			startActivity(intent);
	            	
	            	
	            }  
	        };  
	  
	        SpannableString spanableInfo = new SpannableString(Html.fromHtml(AppTools.changeStringColor("#808080",
					"温馨提示：手机触屏版支持微信和支付宝充值，")
					+ AppTools.changeStringColor("#0d52c3",
							"戳我吧！")));  
	        int start =21;  //超链接起始位置  
	        int end = 24;   //超链接结束位置  
	  
	       
	        spanableInfo.setSpan(new Clickable(listener), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);  
	  
	        return spanableInfo;  
	    }

	class Clickable extends ClickableSpan implements View.OnClickListener {
		private final View.OnClickListener mListener;

		public Clickable(View.OnClickListener listener) {
			mListener = listener;
		}

		@Override
		public void onClick(View view) {
			mListener.onClick(view);
		}
	}
	}  
	  
